package com.example.demo;

import com.example.demo.domain.CompanySetName;
import com.tanx.cqrs.command.CommandBus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
@RequestMapping("test")
public class TestController {
    @Autowired
    private ApplicationContext context;
    @Autowired
    private CommandBus bus;

    @RequestMapping
    public String test(String uuid, String newName) {
        bus.send(new CompanySetName(uuid, newName));
        return "succuess";
    }
}
